{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 将所有特征串联起来，构成RS_Train.csv\n",
    "#RS_Test.csv\n",
    "#为最后推荐系统做准备\n",
    "from __future__ import division\n",
    "\n",
    "import cPickle\n",
    "import numpy as np\n",
    "import scipy.io as sio\n",
    "import scipy.sparse as ss\n",
    "import scipy.spatial.distance as ssd\n",
    "from numpy.random import random  \n",
    "from collections import defaultdict\n",
    "\n",
    "class RecommonderSystem:\n",
    "  def __init__(self):\n",
    "    # 读入数据做初始化\n",
    "    \n",
    "    #用户和活动新的索引\n",
    "    self.userIndex = cPickle.load(open(\"PE_userIndex.pkl\", 'rb'))\n",
    "    self.eventIndex = cPickle.load(open(\"PE_eventIndex.pkl\", 'rb'))\n",
    "    self.n_users = len(self.userIndex)\n",
    "    self.n_items = len(self.eventIndex)\n",
    "    \n",
    "    #用户-活动关系矩阵R\n",
    "    #在train_SVD会重新从文件中读取,二者要求的格式不同，来不及统一了:(\n",
    "    self.userEventScores = sio.mmread(\"PE_userEventScores\").todense()\n",
    "    \n",
    "    #倒排表\n",
    "    ##每个用户参加的事件\n",
    "    self.itemsForUser = cPickle.load(open(\"PE_eventsForUser.pkl\", 'rb'))\n",
    "    ##事件参加的用户\n",
    "    self.usersForItem = cPickle.load(open(\"PE_usersForEvent.pkl\", 'rb'))\n",
    "    \n",
    "    #基于模型的协同过滤参数初始化,训练\n",
    "    self.init_SVD()\n",
    "    self.train_SVD(trainfile = \"train.csv\")\n",
    "    \n",
    "    #根据用户属性计算出的用户之间的相似度\n",
    "    self.userSimMatrix = sio.mmread(\"US_userSimMatrix\").todense()\n",
    "    \n",
    "    #根据活动属性计算出的活动之间的相似度\n",
    "    self.eventPropSim = sio.mmread(\"EV_eventPropSim\").todense()\n",
    "    self.eventContSim = sio.mmread(\"EV_eventContSim\").todense()\n",
    "    \n",
    "    #每个用户的朋友的数目\n",
    "    self.numFriends = sio.mmread(\"UF_numFriends\")\n",
    "    #用户的每个朋友参加活动的分数对该用户的影响\n",
    "    self.userFriends = sio.mmread(\"UF_userFriends\").todense()\n",
    "    \n",
    "    #活动本身的热度\n",
    "    self.eventPopularity = sio.mmread(\"EA_eventPopularity\").todense()\n",
    "\n",
    "  def init_SVD(self, K=20):\n",
    "    #初始化模型参数（for 基于模型的协同过滤SVD_CF）\n",
    "    self.K = K  \n",
    "    \n",
    "    #init parameters\n",
    "    #bias\n",
    "    self.bi = np.zeros(self.n_items)  \n",
    "    self.bu = np.zeros(self.n_users)  \n",
    "    \n",
    "    #the small matrix\n",
    "    self.P = random((self.n_users,self.K))/10*(np.sqrt(self.K))\n",
    "    self.Q = random((self.K, self.n_items))/10*(np.sqrt(self.K))  \n",
    "                  \n",
    "          \n",
    "  def train_SVD(self,trainfile = 'train.csv', steps=100,gamma=0.04,Lambda=0.15):\n",
    "    #训练SVD模型（for 基于模型的协同过滤SVD_CF）\n",
    "    #gamma：为学习率\n",
    "    #Lambda：正则参数\n",
    "    \n",
    "    #偷懒了，为了和原来的代码的输入接口一样，直接从训练文件中去读取数据\n",
    "    print \"SVD Train...\"\n",
    "    ftrain = open(trainfile, 'r')\n",
    "    ftrain.readline()\n",
    "    self.mu = 0.0\n",
    "    n_records = 0\n",
    "    uids = []  #每条记录的用户索引\n",
    "    i_ids = [] #每条记录的item索引\n",
    "    #用户-Item关系矩阵R（内容同userEventScores相同），临时变量，训练完了R不再需要\n",
    "    R = np.zeros((self.n_users, self.n_items))\n",
    "    \n",
    "    for line in ftrain:\n",
    "        cols = line.strip().split(\",\")\n",
    "        u = self.userIndex[cols[0]]  #用户\n",
    "        i = self.eventIndex[cols[1]] #活动\n",
    "        \n",
    "        uids.append(u)\n",
    "        i_ids.append(i)\n",
    "        \n",
    "        R[u,i] = int(cols[4])  #interested\n",
    "        self.mu += R[u,i]\n",
    "        n_records += 1\n",
    "    \n",
    "    ftrain.close()\n",
    "    self.mu /= n_records\n",
    "    \n",
    "    \n",
    "    # 请补充完整SVD模型训练过程\n",
    "    \n",
    "    for step in range(steps):\n",
    "        print 'the ',step,'-th step is running:'\n",
    "        rmse_sum = 0.0\n",
    "        \n",
    "        for j in range(len(uids)):\n",
    "            userid = uids[j]\n",
    "            itemid = i_ids[j]\n",
    "            interested = R[userid,itemid]\n",
    "            \n",
    "            eui = interested-self.pred_SVD(userid,itemid)\n",
    "            rmse_sum += eui**2\n",
    "            \n",
    "            self.bu[userid] += gamma*(eui-Lambda*self.bu[userid])\n",
    "            self.bi[itemid] += gamma*(eui-Lambda*self.bi[itemid])\n",
    "            \n",
    "            temp = self.Q[:,itemid]\n",
    "            self.Q[:,itemid] += gamma*(eui*self.P[userid,:]-Lambda*self.Q[:,itemid])\n",
    "            self.P[userid,:] += gamma*(eui*temp-Lambda*self.P[userid,:])\n",
    "            \n",
    "        gamma=gamma*0.93\n",
    "        print 'the rmse of this step on train data is ',np.sqrt(rmse_sum/len(uids))\n",
    "\n",
    "    print \"SVD trained\"\n",
    "    \n",
    "  def pred_SVD(self, uid, i_id):\n",
    "    #根据当前参数，预测用户uid对Item（i_id）的打分        \n",
    "    ans=self.mu + self.bi[i_id] + self.bu[uid] + np.dot(self.P[uid,:],self.Q[:,i_id])  \n",
    "        \n",
    "    #将打分范围控制在0-1之间\n",
    "    if ans>1:  \n",
    "        return 1  \n",
    "    elif ans<0:  \n",
    "        return 0\n",
    "    return ans  \n",
    "\n",
    "  def sim_cal_UserCF(self, uid1, uid2 ):\n",
    "    #请补充基于用户的协同过滤中的两个用户uid1和uid2之间的相似度（根据两个用户对item打分的相似度）\n",
    "    similarity = 0.0\n",
    "    \n",
    "    si={}\n",
    "    for item in self.itemsForUser[uid1]:\n",
    "        if item in self.itemsForUser[uid2]:\n",
    "            si[item]=1\n",
    "            \n",
    "    n=len(si)\n",
    "    if(n==0):\n",
    "        similarity=0\n",
    "        return similarity\n",
    "    \n",
    "    s1 = np.array([self.userEventScores[uid1,item] for item in si])\n",
    "    s2 = np.array([self.userEventScores[uid2,item] for item in si])\n",
    "    \n",
    "    sum1 = np.sum(s1)\n",
    "    sum2 = np.sum(s2)\n",
    "    sum1Sq = np.sum(s1**2)\n",
    "    sum2Sq = np.sum(s2**2)\n",
    "    pSum = np.sum(s1*s2)\n",
    "    \n",
    "    num = pSum-(sum1*sum2/n)\n",
    "    den = np.sqrt((sum1Sq-sum1**2/n) * (sum2Sq-sum2**2/n))\n",
    "    if den==0:\n",
    "        similarity = 0\n",
    "        return similarity\n",
    "    \n",
    "    similarity = num/den\n",
    "    \n",
    "    return similarity  \n",
    "\n",
    "  def userCFReco(self, userId, eventId):\n",
    "    \"\"\"\n",
    "    根据User-based协同过滤，得到event的推荐度\n",
    "    基本的伪代码思路如下：\n",
    "    for item i\n",
    "      for every other user v that has a preference for i\n",
    "        compute similarity s between u and v\n",
    "        incorporate v's preference for i weighted by s into running average\n",
    "    return top items ranked by weighted average\n",
    "    \"\"\"\n",
    "    #请补充完整代码\n",
    "    ans = 0.0\n",
    "    \n",
    "    sim_accumulate=0.0\n",
    "    rat_acc=0.0\n",
    "    uid = self.userIndex[userId]\n",
    "    eid = self.eventIndex[eventId]\n",
    "    \n",
    "    for user in self.usersForItem[eid]:\n",
    "        sim = self.sim_cal_UserCF(user,uid)\n",
    "        if sim<=0:continue\n",
    "        rat_acc += sim * self.userEventScores[user,eid]\n",
    "        sim_accumulate += sim\n",
    "        \n",
    "    if sim_accumulate==0:\n",
    "        ans = self.mu\n",
    "        return ans\n",
    "    ans = rat_acc/sim_accumulate\n",
    "        \n",
    "    return ans\n",
    "\n",
    "\n",
    "  def sim_cal_ItemCF(self, i_id1, i_id2):\n",
    "    #计算Item i_id1和i_id2之间的相似性\n",
    "    #请补充完整代码\n",
    "    similarity = 0.0\n",
    "    \n",
    "    si={}\n",
    "    for user in self.usersForItem[i_id1]:\n",
    "        if user in self.usersForItem[i_id2]:\n",
    "            si[user]=1\n",
    "            \n",
    "    n=len(si)\n",
    "    if(n==0):\n",
    "        similarity=0\n",
    "        return similarity\n",
    "    \n",
    "    s1 = np.array([self.userEventScores[user,i_id1] for user in si])\n",
    "    s2 = np.array([self.userEventScores[user,i_id2] for user in si])\n",
    "    \n",
    "    sum1 = np.sum(s1)\n",
    "    sum2 = np.sum(s2)\n",
    "    sum1Sq = np.sum(s1**2)\n",
    "    sum2Sq = np.sum(s2**2)\n",
    "    pSum = np.sum(s1*s2)\n",
    "    \n",
    "    num = pSum-(sum1*sum2/n)\n",
    "    den = np.sqrt((sum1Sq-sum1**2/n) * (sum2Sq-sum2**2/n))\n",
    "    if den==0:\n",
    "        similarity = 0\n",
    "        return similarity\n",
    "    \n",
    "    similarity = num/den\n",
    "    \n",
    "    return similarity     \n",
    "        \n",
    "#     return num/den  \n",
    "            \n",
    "  def eventCFReco(self, userId, eventId):    \n",
    "    \"\"\"\n",
    "    根据基于物品的协同过滤，得到Event的推荐度\n",
    "    基本的伪代码思路如下：\n",
    "    for item i \n",
    "        for every item j tht u has a preference for\n",
    "            compute similarity s between i and j\n",
    "            add u's preference for j weighted by s to a running average\n",
    "    return top items, ranked by weighted average\n",
    "    \"\"\"\n",
    "    #请补充完整代码\n",
    "    ans = 0.0\n",
    "  \n",
    "    sim_accumulate=0.0\n",
    "    rat_acc=0.0\n",
    "    uid = self.userIndex[userId]\n",
    "    eid = self.eventIndex[eventId]\n",
    "    \n",
    "    for item in self.itemsForUser[uid]:\n",
    "        sim = self.sim_cal_ItemCF(item,eid)\n",
    "        if sim<0:continue\n",
    "        \n",
    "        rat_acc += sim * self.userEventScores[uid,item]\n",
    "        sim_accumulate += sim\n",
    "        \n",
    "    if sim_accumulate==0:\n",
    "        return self.mu\n",
    "    ans = rat_acc/sim_accumulate\n",
    "\n",
    "    return ans\n",
    "    \n",
    "  def svdCFReco(self, userId, eventId):\n",
    "    #基于模型的协同过滤, SVD++/LFM\n",
    "    u = self.userIndex[userId]\n",
    "    i = self.eventIndex[eventId]\n",
    "\n",
    "    return self.pred_SVD(u,i)\n",
    "\n",
    "  def userReco(self, userId, eventId):\n",
    "    \"\"\"\n",
    "    类似基于User-based协同过滤，只是用户之间的相似度由用户本身的属性得到，计算event的推荐度\n",
    "    基本的伪代码思路如下：\n",
    "    for item i\n",
    "      for every other user v that has a preference for i\n",
    "        compute similarity s between u and v\n",
    "        incorporate v's preference for i weighted by s into running aversge\n",
    "    return top items ranked by weighted average\n",
    "    \"\"\"\n",
    "    i = self.userIndex[userId]\n",
    "    j = self.eventIndex[eventId]\n",
    "\n",
    "    vs = self.userEventScores[:, j]\n",
    "    sims = self.userSimMatrix[i, :]\n",
    "\n",
    "    prod = sims * vs\n",
    "\n",
    "    try:\n",
    "      return prod[0, 0] - self.userEventScores[i, j]\n",
    "    except IndexError:\n",
    "      return 0\n",
    "\n",
    "  def eventReco(self, userId, eventId):\n",
    "    \"\"\"\n",
    "    类似基于Item-based协同过滤，只是item之间的相似度由item本身的属性得到，计算Event的推荐度\n",
    "    基本的伪代码思路如下：\n",
    "    for item i \n",
    "      for every item j that u has a preference for\n",
    "        compute similarity s between i and j\n",
    "        add u's preference for j weighted by s to a running average\n",
    "    return top items, ranked by weighted average\n",
    "    \"\"\"\n",
    "    i = self.userIndex[userId]\n",
    "    j = self.eventIndex[eventId]\n",
    "    js = self.userEventScores[i, :]\n",
    "    psim = self.eventPropSim[:, j]\n",
    "    csim = self.eventContSim[:, j]\n",
    "    pprod = js * psim\n",
    "    cprod = js * csim\n",
    "    \n",
    "    pscore = 0\n",
    "    cscore = 0\n",
    "    try:\n",
    "      pscore = pprod[0, 0] - self.userEventScores[i, j]\n",
    "    except IndexError:\n",
    "      pass\n",
    "    try:\n",
    "      cscore = cprod[0, 0] - self.userEventScores[i, j]\n",
    "    except IndexError:\n",
    "      pass\n",
    "    return pscore, cscore\n",
    "\n",
    "  def userPop(self, userId):\n",
    "    \"\"\"\n",
    "    基于用户的朋友个数来推断用户的社交程度\n",
    "    主要的考量是如果用户的朋友非常多，可能会更倾向于参加各种社交活动\n",
    "    \"\"\"\n",
    "    if self.userIndex.has_key(userId):\n",
    "      i = self.userIndex[userId]\n",
    "      try:\n",
    "        return self.numFriends[0, i]\n",
    "      except IndexError:\n",
    "        return 0\n",
    "    else:\n",
    "      return 0\n",
    "\n",
    "  def friendInfluence(self, userId):\n",
    "    \"\"\"\n",
    "    朋友对用户的影响\n",
    "    主要考虑用户所有的朋友中，有多少是非常喜欢参加各种社交活动/event的\n",
    "    用户的朋友圈如果都积极参与各种event，可能会对当前用户有一定的影响\n",
    "    \"\"\"\n",
    "    nusers = np.shape(self.userFriends)[1]\n",
    "    i = self.userIndex[userId]\n",
    "    return (self.userFriends[i, :].sum(axis=0) / nusers)[0,0]\n",
    "\n",
    "  def eventPop(self, eventId):\n",
    "    \"\"\"\n",
    "    本活动本身的热度\n",
    "    主要是通过参与的人数来界定的\n",
    "    \"\"\"\n",
    "    i = self.eventIndex[eventId]\n",
    "    return self.eventPopularity[i, 0]\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [],
   "source": [
    "def generateRSData(RS, train=True, header=True):\n",
    "    \"\"\"\n",
    "    把前面user-based协同过滤 和 item-based协同过滤，以及各种热度和影响度作为特征组合在一起\n",
    "    生成新的训练数据，用于分类器分类使用\n",
    "    \"\"\"\n",
    "    fn = \"train.csv\" if train else \"test.csv\"\n",
    "    fin = open(fn, 'rb')\n",
    "    fout = open(\"RS_\" + fn, 'wb')\n",
    "    \n",
    "    #忽略第一行（列名字）\n",
    "    fin.readline().strip().split(\",\")\n",
    "    \n",
    "    # write output header\n",
    "    if header:\n",
    "      ocolnames = [\"invited\", \"userCF_reco\", \"evtCF_reco\",\"svdCF_reco\",\"user_reco\", \"evt_p_reco\",\n",
    "        \"evt_c_reco\", \"user_pop\", \"frnd_infl\", \"evt_pop\"]\n",
    "      if train:\n",
    "        ocolnames.append(\"interested\")\n",
    "        ocolnames.append(\"not_interested\")\n",
    "      fout.write(\",\".join(ocolnames) + \"\\n\")\n",
    "    \n",
    "    ln = 0\n",
    "    for line in fin: \n",
    "      ln += 1\n",
    "      if ln%500 == 0: \n",
    "          print \"%s:%d (userId, eventId)=(%s, %s)\" % (fn, ln, userId, eventId)\n",
    "          #break;\n",
    "      \n",
    "      cols = line.strip().split(\",\")\n",
    "      userId = cols[0]\n",
    "      eventId = cols[1]\n",
    "      invited = cols[2]\n",
    "      \n",
    "      userCF_reco = RS.userCFReco(userId, eventId)\n",
    "      itemCF_reco = RS.eventCFReco(userId, eventId)\n",
    "      svdCF_reco = RS.svdCFReco(userId, eventId)\n",
    "        \n",
    "      user_reco = RS.userReco(userId, eventId)\n",
    "      evt_p_reco, evt_c_reco = RS.eventReco(userId, eventId)\n",
    "      user_pop = RS.userPop(userId)\n",
    "     \n",
    "      frnd_infl = RS.friendInfluence(userId)\n",
    "      evt_pop = RS.eventPop(eventId)\n",
    "      ocols = [invited, userCF_reco, itemCF_reco, svdCF_reco,user_reco, evt_p_reco,\n",
    "        evt_c_reco, user_pop, frnd_infl, evt_pop]\n",
    "      \n",
    "      if train:\n",
    "        ocols.append(cols[4]) # interested\n",
    "        ocols.append(cols[5]) # not_interested\n",
    "      fout.write(\",\".join(map(lambda x: str(x), ocols)) + \"\\n\")\n",
    "    \n",
    "    fin.close()\n",
    "    fout.close()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "SVD Train...\n",
      "the  0 -th step is running:\n",
      "the rmse of this step on train data is  0.740653168347\n",
      "the  1 -th step is running:\n",
      "the rmse of this step on train data is  0.535459795845\n",
      "the  2 -th step is running:\n",
      "the rmse of this step on train data is  0.429274707207\n",
      "the  3 -th step is running:\n",
      "the rmse of this step on train data is  0.380934294234\n",
      "the  4 -th step is running:\n",
      "the rmse of this step on train data is  0.35413056345\n",
      "the  5 -th step is running:\n",
      "the rmse of this step on train data is  0.336609811451\n",
      "the  6 -th step is running:\n",
      "the rmse of this step on train data is  0.323870215567\n",
      "the  7 -th step is running:\n",
      "the rmse of this step on train data is  0.313981229279\n",
      "the  8 -th step is running:\n",
      "the rmse of this step on train data is  0.305978675933\n",
      "the  9 -th step is running:\n",
      "the rmse of this step on train data is  0.299332882384\n",
      "the  10 -th step is running:\n",
      "the rmse of this step on train data is  0.293718382897\n",
      "the  11 -th step is running:\n",
      "the rmse of this step on train data is  0.288906667153\n",
      "the  12 -th step is running:\n",
      "the rmse of this step on train data is  0.284742572511\n",
      "the  13 -th step is running:\n",
      "the rmse of this step on train data is  0.281110006823\n",
      "the  14 -th step is running:\n",
      "the rmse of this step on train data is  0.277919232214\n",
      "the  15 -th step is running:\n",
      "the rmse of this step on train data is  0.27510014867\n",
      "the  16 -th step is running:\n",
      "the rmse of this step on train data is  0.27259595897\n",
      "the  17 -th step is running:\n",
      "the rmse of this step on train data is  0.270363039112\n",
      "the  18 -th step is running:\n",
      "the rmse of this step on train data is  0.268364382567\n",
      "the  19 -th step is running:\n",
      "the rmse of this step on train data is  0.266569336065\n",
      "the  20 -th step is running:\n",
      "the rmse of this step on train data is  0.264951106002\n",
      "the  21 -th step is running:\n",
      "the rmse of this step on train data is  0.263488823618\n",
      "the  22 -th step is running:\n",
      "the rmse of this step on train data is  0.262164668449\n",
      "the  23 -th step is running:\n",
      "the rmse of this step on train data is  0.260962935339\n",
      "the  24 -th step is running:\n",
      "the rmse of this step on train data is  0.259870123774\n",
      "the  25 -th step is running:\n",
      "the rmse of this step on train data is  0.258874558752\n",
      "the  26 -th step is running:\n",
      "the rmse of this step on train data is  0.257966078236\n",
      "the  27 -th step is running:\n",
      "the rmse of this step on train data is  0.257135832892\n",
      "the  28 -th step is running:\n",
      "the rmse of this step on train data is  0.256376051195\n",
      "the  29 -th step is running:\n",
      "the rmse of this step on train data is  0.25567988046\n",
      "the  30 -th step is running:\n",
      "the rmse of this step on train data is  0.255041265882\n",
      "the  31 -th step is running:\n",
      "the rmse of this step on train data is  0.254454834747\n",
      "the  32 -th step is running:\n",
      "the rmse of this step on train data is  0.253915804741\n",
      "the  33 -th step is running:\n",
      "the rmse of this step on train data is  0.253419906047\n",
      "the  34 -th step is running:\n",
      "the rmse of this step on train data is  0.252963314793\n",
      "the  35 -th step is running:\n",
      "the rmse of this step on train data is  0.252542600527\n",
      "the  36 -th step is running:\n",
      "the rmse of this step on train data is  0.252154677529\n",
      "the  37 -th step is running:\n",
      "the rmse of this step on train data is  0.25179676373\n",
      "the  38 -th step is running:\n",
      "the rmse of this step on train data is  0.251466344831\n",
      "the  39 -th step is running:\n",
      "the rmse of this step on train data is  0.251161143479\n",
      "the  40 -th step is running:\n",
      "the rmse of this step on train data is  0.250879094449\n",
      "the  41 -th step is running:\n",
      "the rmse of this step on train data is  0.25061832119\n",
      "the  42 -th step is running:\n",
      "the rmse of this step on train data is  0.250377116216\n",
      "the  43 -th step is running:\n",
      "the rmse of this step on train data is  0.250153923034\n",
      "the  44 -th step is running:\n",
      "the rmse of this step on train data is  0.249947321251\n",
      "the  45 -th step is running:\n",
      "the rmse of this step on train data is  0.249756012983\n",
      "the  46 -th step is running:\n",
      "the rmse of this step on train data is  0.249578810735\n",
      "the  47 -th step is running:\n",
      "the rmse of this step on train data is  0.249414626947\n",
      "the  48 -th step is running:\n",
      "the rmse of this step on train data is  0.249262464418\n",
      "the  49 -th step is running:\n",
      "the rmse of this step on train data is  0.249121407882\n",
      "the  50 -th step is running:\n",
      "the rmse of this step on train data is  0.248990616663\n",
      "the  51 -th step is running:\n",
      "the rmse of this step on train data is  0.248869317874\n",
      "the  52 -th step is running:\n",
      "the rmse of this step on train data is  0.248756800347\n",
      "the  53 -th step is running:\n",
      "the rmse of this step on train data is  0.248652409237\n",
      "the  54 -th step is running:\n",
      "the rmse of this step on train data is  0.248555541159\n",
      "the  55 -th step is running:\n",
      "the rmse of this step on train data is  0.248465639763\n",
      "the  56 -th step is running:\n",
      "the rmse of this step on train data is  0.248382191767\n",
      "the  57 -th step is running:\n",
      "the rmse of this step on train data is  0.24830472339\n",
      "the  58 -th step is running:\n",
      "the rmse of this step on train data is  0.248232797055\n",
      "the  59 -th step is running:\n",
      "the rmse of this step on train data is  0.248166008476\n",
      "the  60 -th step is running:\n",
      "the rmse of this step on train data is  0.248103983895\n",
      "the  61 -th step is running:\n",
      "the rmse of this step on train data is  0.248046377679\n",
      "the  62 -th step is running:\n",
      "the rmse of this step on train data is  0.247992870062\n",
      "the  63 -th step is running:\n",
      "the rmse of this step on train data is  0.247943165114\n",
      "the  64 -th step is running:\n",
      "the rmse of this step on train data is  0.247896988835\n",
      "the  65 -th step is running:\n",
      "the rmse of this step on train data is  0.247854087487\n",
      "the  66 -th step is running:\n",
      "the rmse of this step on train data is  0.247814226019\n",
      "the  67 -th step is running:\n",
      "the rmse of this step on train data is  0.247777186626\n",
      "the  68 -th step is running:\n",
      "the rmse of this step on train data is  0.247742767436\n",
      "the  69 -th step is running:\n",
      "the rmse of this step on train data is  0.2477107813\n",
      "the  70 -th step is running:\n",
      "the rmse of this step on train data is  0.24768105468\n",
      "the  71 -th step is running:\n",
      "the rmse of this step on train data is  0.247653426622\n",
      "the  72 -th step is running:\n",
      "the rmse of this step on train data is  0.247627747823\n",
      "the  73 -th step is running:\n",
      "the rmse of this step on train data is  0.247603879757\n",
      "the  74 -th step is running:\n",
      "the rmse of this step on train data is  0.247581693878\n",
      "the  75 -th step is running:\n",
      "the rmse of this step on train data is  0.247561070882\n",
      "the  76 -th step is running:\n",
      "the rmse of this step on train data is  0.247541900026\n",
      "the  77 -th step is running:\n",
      "the rmse of this step on train data is  0.247524078501\n",
      "the  78 -th step is running:\n",
      "the rmse of this step on train data is  0.247507510854\n",
      "the  79 -th step is running:\n",
      "the rmse of this step on train data is  0.247492108449\n",
      "the  80 -th step is running:\n",
      "the rmse of this step on train data is  0.247477788973\n",
      "the  81 -th step is running:\n",
      "the rmse of this step on train data is  0.247464475975\n",
      "the  82 -th step is running:\n",
      "the rmse of this step on train data is  0.247452098446\n",
      "the  83 -th step is running:\n",
      "the rmse of this step on train data is  0.247440590419\n",
      "the  84 -th step is running:\n",
      "the rmse of this step on train data is  0.247429890613\n",
      "the  85 -th step is running:\n",
      "the rmse of this step on train data is  0.247419942093\n",
      "the  86 -th step is running:\n",
      "the rmse of this step on train data is  0.247410691957\n",
      "the  87 -th step is running:\n",
      "the rmse of this step on train data is  0.247402091049\n",
      "the  88 -th step is running:\n",
      "the rmse of this step on train data is  0.247394093691\n",
      "the  89 -th step is running:\n",
      "the rmse of this step on train data is  0.247386657433\n",
      "the  90 -th step is running:\n",
      "the rmse of this step on train data is  0.247379742825\n",
      "the  91 -th step is running:\n",
      "the rmse of this step on train data is  0.247373313199\n",
      "the  92 -th step is running:\n",
      "the rmse of this step on train data is  0.247367334479\n",
      "the  93 -th step is running:\n",
      "the rmse of this step on train data is  0.247361774987\n",
      "the  94 -th step is running:\n",
      "the rmse of this step on train data is  0.247356605281\n",
      "the  95 -th step is running:\n",
      "the rmse of this step on train data is  0.247351797991\n",
      "the  96 -th step is running:\n",
      "the rmse of this step on train data is  0.247347327677\n",
      "the  97 -th step is running:\n",
      "the rmse of this step on train data is  0.247343170686\n",
      "the  98 -th step is running:\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "the rmse of this step on train data is  0.247339305032\n",
      "the  99 -th step is running:\n",
      "the rmse of this step on train data is  0.247335710274\n",
      "SVD trained\n",
      "生成训练数据...\n",
      "\n",
      "train.csv:500 (userId, eventId)=(123290209, 1887085024)\n",
      "train.csv:1000 (userId, eventId)=(272886293, 199858305)\n",
      "train.csv:1500 (userId, eventId)=(395305791, 1582270949)\n",
      "train.csv:2000 (userId, eventId)=(527523423, 3272728211)\n",
      "train.csv:2500 (userId, eventId)=(651258472, 792632006)\n",
      "train.csv:3000 (userId, eventId)=(811791433, 524756826)\n",
      "train.csv:3500 (userId, eventId)=(985547042, 1269035551)\n",
      "train.csv:4000 (userId, eventId)=(1107615001, 173949238)\n",
      "train.csv:4500 (userId, eventId)=(1236336671, 3849306291)\n",
      "train.csv:5000 (userId, eventId)=(1414301782, 2652356640)\n",
      "train.csv:5500 (userId, eventId)=(1595465532, 955398943)\n",
      "train.csv:6000 (userId, eventId)=(1747091728, 2131379889)\n",
      "train.csv:6500 (userId, eventId)=(1914182220, 955398943)\n",
      "train.csv:7000 (userId, eventId)=(2071842684, 1076364848)\n",
      "train.csv:7500 (userId, eventId)=(2217853337, 3051438735)\n",
      "train.csv:8000 (userId, eventId)=(2338481531, 2525447278)\n",
      "train.csv:8500 (userId, eventId)=(2489551967, 520657921)\n",
      "train.csv:9000 (userId, eventId)=(2650493630, 87962584)\n",
      "train.csv:9500 (userId, eventId)=(2791418962, 4223848259)\n",
      "train.csv:10000 (userId, eventId)=(2903662804, 2791462807)\n",
      "train.csv:10500 (userId, eventId)=(3036141956, 3929507420)\n",
      "train.csv:11000 (userId, eventId)=(3176074542, 3459485614)\n",
      "train.csv:11500 (userId, eventId)=(3285425249, 2271782630)\n",
      "train.csv:12000 (userId, eventId)=(3410667855, 1063772489)\n",
      "train.csv:12500 (userId, eventId)=(3531604778, 2584839423)\n",
      "train.csv:13000 (userId, eventId)=(3686871863, 53495098)\n",
      "train.csv:13500 (userId, eventId)=(3833637800, 2415873572)\n",
      "train.csv:14000 (userId, eventId)=(3944021305, 2096772901)\n",
      "train.csv:14500 (userId, eventId)=(4075466480, 3567240505)\n",
      "train.csv:15000 (userId, eventId)=(4197193550, 1628057176)\n",
      "生成预测数据...\n",
      "\n",
      "test.csv:500 (userId, eventId)=(182290053, 2529072432)\n",
      "test.csv:1000 (userId, eventId)=(433510318, 4244463632)\n",
      "test.csv:1500 (userId, eventId)=(632808865, 2845303452)\n",
      "test.csv:2000 (userId, eventId)=(813611885, 2036538169)\n",
      "test.csv:2500 (userId, eventId)=(1010701404, 303459881)\n",
      "test.csv:3000 (userId, eventId)=(1210932037, 2529072432)\n",
      "test.csv:3500 (userId, eventId)=(1452921099, 2705317682)\n",
      "test.csv:4000 (userId, eventId)=(1623287180, 1626678328)\n",
      "test.csv:4500 (userId, eventId)=(1855201342, 2603032829)\n",
      "test.csv:5000 (userId, eventId)=(2083900381, 2529072432)\n",
      "test.csv:5500 (userId, eventId)=(2318415276, 2509151803)\n",
      "test.csv:6000 (userId, eventId)=(2528161539, 4025975316)\n",
      "test.csv:6500 (userId, eventId)=(2749110768, 4244406355)\n",
      "test.csv:7000 (userId, eventId)=(2927772127, 1532377761)\n",
      "test.csv:7500 (userId, eventId)=(3199685636, 1776393554)\n",
      "test.csv:8000 (userId, eventId)=(3393388475, 680270887)\n",
      "test.csv:8500 (userId, eventId)=(3601169721, 154434302)\n",
      "test.csv:9000 (userId, eventId)=(3828963415, 3067222491)\n",
      "test.csv:9500 (userId, eventId)=(4018723397, 2522610844)\n",
      "test.csv:10000 (userId, eventId)=(4180064266, 2658555390)\n"
     ]
    }
   ],
   "source": [
    "RS = RecommonderSystem()\n",
    "print \"生成训练数据...\\n\"\n",
    "generateRSData(RS,train=True,  header=True)\n",
    "\n",
    "print \"生成预测数据...\\n\"\n",
    "generateRSData(RS, train=False, header=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>invited</th>\n",
       "      <th>userCF_reco</th>\n",
       "      <th>evtCF_reco</th>\n",
       "      <th>svdCF_reco</th>\n",
       "      <th>user_reco</th>\n",
       "      <th>evt_p_reco</th>\n",
       "      <th>evt_c_reco</th>\n",
       "      <th>user_pop</th>\n",
       "      <th>frnd_infl</th>\n",
       "      <th>evt_pop</th>\n",
       "      <th>interested</th>\n",
       "      <th>not_interested</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.020680</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>8.911768e-01</td>\n",
       "      <td>0.942729</td>\n",
       "      <td>0.000231</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-0.000039</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.000989</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>1.691736e-01</td>\n",
       "      <td>0.680113</td>\n",
       "      <td>0.000231</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000018</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.591891</td>\n",
       "      <td>0.448648</td>\n",
       "      <td>126.941808</td>\n",
       "      <td>-1.000000e+00</td>\n",
       "      <td>-1.000000</td>\n",
       "      <td>0.000231</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000173</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.094111</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>1.066331e+00</td>\n",
       "      <td>0.752357</td>\n",
       "      <td>0.000231</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000016</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0</td>\n",
       "      <td>0.020833</td>\n",
       "      <td>0.168161</td>\n",
       "      <td>0.162595</td>\n",
       "      <td>28.826764</td>\n",
       "      <td>2.507789e-07</td>\n",
       "      <td>0.984118</td>\n",
       "      <td>0.000231</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000064</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>0</td>\n",
       "      <td>0.108696</td>\n",
       "      <td>0.213934</td>\n",
       "      <td>0.228611</td>\n",
       "      <td>36.132055</td>\n",
       "      <td>2.261498e-07</td>\n",
       "      <td>0.984118</td>\n",
       "      <td>0.000231</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000235</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.132864</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>1.524557e+00</td>\n",
       "      <td>2.975531</td>\n",
       "      <td>0.000160</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000016</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>0</td>\n",
       "      <td>0.857820</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.741982</td>\n",
       "      <td>5.759882</td>\n",
       "      <td>3.165701e-02</td>\n",
       "      <td>0.788799</td>\n",
       "      <td>0.000160</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000566</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>0</td>\n",
       "      <td>0.917727</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.576810</td>\n",
       "      <td>4.649493</td>\n",
       "      <td>-4.849421e-01</td>\n",
       "      <td>0.951921</td>\n",
       "      <td>0.000160</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.001215</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.217389</td>\n",
       "      <td>0.441210</td>\n",
       "      <td>1.524558e+00</td>\n",
       "      <td>2.794073</td>\n",
       "      <td>0.000160</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-0.000014</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>0</td>\n",
       "      <td>0.666667</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.433001</td>\n",
       "      <td>0.000007</td>\n",
       "      <td>-4.832136e-01</td>\n",
       "      <td>0.763753</td>\n",
       "      <td>0.000160</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000060</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.099387</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>1.524557e+00</td>\n",
       "      <td>2.739166</td>\n",
       "      <td>0.000160</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-0.000058</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.527799</td>\n",
       "      <td>1.936730</td>\n",
       "      <td>5.161895e-01</td>\n",
       "      <td>2.837133</td>\n",
       "      <td>0.000160</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000230</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>0</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.604172</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>-1.000000e+00</td>\n",
       "      <td>-1.000000</td>\n",
       "      <td>0.000076</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000258</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.995952</td>\n",
       "      <td>0.000076</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-0.000081</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.999604</td>\n",
       "      <td>0.000076</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000060</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.997483</td>\n",
       "      <td>0.000076</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000018</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.198676</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>5.414258e-01</td>\n",
       "      <td>0.998719</td>\n",
       "      <td>0.000076</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000012</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.056423</td>\n",
       "      <td>1.518717</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.995952</td>\n",
       "      <td>0.000076</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-0.000055</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.055742</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.787261</td>\n",
       "      <td>0.000015</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000005</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.079278</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>6.306272e-01</td>\n",
       "      <td>0.998451</td>\n",
       "      <td>0.000015</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000090</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.089385</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.994036</td>\n",
       "      <td>0.000015</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000037</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>0</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.638245</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>-1.000000e+00</td>\n",
       "      <td>-1.000000</td>\n",
       "      <td>0.000015</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000012</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.065172</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>6.944240e-01</td>\n",
       "      <td>0.996427</td>\n",
       "      <td>0.000015</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000012</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.091327</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.997275</td>\n",
       "      <td>0.000015</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000028</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.063161</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>6.904130e-01</td>\n",
       "      <td>0.952145</td>\n",
       "      <td>0.000426</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000025</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.079437</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>2.264284e-06</td>\n",
       "      <td>0.816832</td>\n",
       "      <td>0.000426</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000573</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.065574</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>6.904130e-01</td>\n",
       "      <td>0.833035</td>\n",
       "      <td>0.000426</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000074</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.061933</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>6.904130e-01</td>\n",
       "      <td>0.825322</td>\n",
       "      <td>0.000426</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000046</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>0</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.704432</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>-1.000000e+00</td>\n",
       "      <td>-1.000000</td>\n",
       "      <td>0.000426</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000060</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15368</th>\n",
       "      <td>0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.084134</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>5.118057e-01</td>\n",
       "      <td>0.971498</td>\n",
       "      <td>0.000218</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000039</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15369</th>\n",
       "      <td>0</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.624248</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>-1.000000e+00</td>\n",
       "      <td>-1.000000</td>\n",
       "      <td>0.000218</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000048</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15370</th>\n",
       "      <td>0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.249453</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>8.891856e-02</td>\n",
       "      <td>0.562281</td>\n",
       "      <td>0.000218</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000260</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15371</th>\n",
       "      <td>0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.048140</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>2.221878e-07</td>\n",
       "      <td>0.797915</td>\n",
       "      <td>0.000218</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15372</th>\n",
       "      <td>0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.135850</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>3.724090e-03</td>\n",
       "      <td>2.255594</td>\n",
       "      <td>0.000024</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000009</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15373</th>\n",
       "      <td>0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.193901</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>3.724090e-03</td>\n",
       "      <td>2.055693</td>\n",
       "      <td>0.000024</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000025</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15374</th>\n",
       "      <td>0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.168835</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>1.012446e-01</td>\n",
       "      <td>2.557705</td>\n",
       "      <td>0.000024</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000108</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15375</th>\n",
       "      <td>0</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.731381</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>-9.962759e-01</td>\n",
       "      <td>0.761978</td>\n",
       "      <td>0.000024</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000032</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15376</th>\n",
       "      <td>0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.148792</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>9.152101e-02</td>\n",
       "      <td>2.546210</td>\n",
       "      <td>0.000024</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000023</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15377</th>\n",
       "      <td>0</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.698275</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>-9.962759e-01</td>\n",
       "      <td>0.712091</td>\n",
       "      <td>0.000024</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000081</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15378</th>\n",
       "      <td>0</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.715636</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>-9.925518e-01</td>\n",
       "      <td>0.816791</td>\n",
       "      <td>0.000024</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000021</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15379</th>\n",
       "      <td>0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.134697</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>3.723854e-03</td>\n",
       "      <td>2.467301</td>\n",
       "      <td>0.000024</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000055</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15380</th>\n",
       "      <td>0</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.726408</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>-1.617411e-01</td>\n",
       "      <td>-0.000419</td>\n",
       "      <td>0.000291</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15381</th>\n",
       "      <td>0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.098446</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>8.382589e-01</td>\n",
       "      <td>1.959044</td>\n",
       "      <td>0.000291</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15382</th>\n",
       "      <td>0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.136332</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>8.382589e-01</td>\n",
       "      <td>1.994727</td>\n",
       "      <td>0.000291</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000012</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15383</th>\n",
       "      <td>0</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.742575</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>-1.617411e-01</td>\n",
       "      <td>-0.000419</td>\n",
       "      <td>0.000291</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000023</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15384</th>\n",
       "      <td>0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.097170</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>1.052417e+00</td>\n",
       "      <td>1.747798</td>\n",
       "      <td>0.000291</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000028</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15385</th>\n",
       "      <td>0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.139060</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>8.382589e-01</td>\n",
       "      <td>1.999084</td>\n",
       "      <td>0.000291</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15386</th>\n",
       "      <td>0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.027634</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>9.912685e-01</td>\n",
       "      <td>0.916116</td>\n",
       "      <td>0.000222</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000012</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15387</th>\n",
       "      <td>1</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.687435</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>-1.000000e+00</td>\n",
       "      <td>-1.000000</td>\n",
       "      <td>0.000222</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-0.000032</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15388</th>\n",
       "      <td>0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.241446</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>1.416244e-01</td>\n",
       "      <td>0.221330</td>\n",
       "      <td>0.000222</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000037</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15389</th>\n",
       "      <td>0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.043293</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>7.774709e-01</td>\n",
       "      <td>0.731846</td>\n",
       "      <td>0.000222</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000067</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15390</th>\n",
       "      <td>0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.021873</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>1.221655e-02</td>\n",
       "      <td>0.976098</td>\n",
       "      <td>0.000222</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000032</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15391</th>\n",
       "      <td>0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.039033</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>9.912685e-01</td>\n",
       "      <td>0.821143</td>\n",
       "      <td>0.000222</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000018</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15392</th>\n",
       "      <td>0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.076621</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000129</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000083</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15393</th>\n",
       "      <td>0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.086058</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>9.450563e-01</td>\n",
       "      <td>0.889712</td>\n",
       "      <td>0.000129</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000196</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15394</th>\n",
       "      <td>0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.076749</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>9.781806e-01</td>\n",
       "      <td>0.938683</td>\n",
       "      <td>0.000129</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000081</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15395</th>\n",
       "      <td>0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.078115</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>7.146114e-01</td>\n",
       "      <td>0.901552</td>\n",
       "      <td>0.000129</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000384</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15396</th>\n",
       "      <td>0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.064235</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>9.116081e-01</td>\n",
       "      <td>0.818156</td>\n",
       "      <td>0.000129</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-0.002080</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15397</th>\n",
       "      <td>0</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.657683</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>-1.000000e+00</td>\n",
       "      <td>-1.000000</td>\n",
       "      <td>0.000129</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000018</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>15398 rows × 12 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "       invited  userCF_reco  evtCF_reco  svdCF_reco   user_reco    evt_p_reco  \\\n",
       "0            0     0.000000    0.268282    0.020680    0.000000  8.911768e-01   \n",
       "1            0     0.000000    0.268282    0.000989    0.000000  1.691736e-01   \n",
       "2            0     1.000000    0.591891    0.448648  126.941808 -1.000000e+00   \n",
       "3            0     0.000000    0.268282    0.094111    0.000000  1.066331e+00   \n",
       "4            0     0.020833    0.168161    0.162595   28.826764  2.507789e-07   \n",
       "5            0     0.108696    0.213934    0.228611   36.132055  2.261498e-07   \n",
       "6            0     0.000000    0.268282    0.132864    0.000000  1.524557e+00   \n",
       "7            0     0.857820    1.000000    0.741982    5.759882  3.165701e-02   \n",
       "8            0     0.917727    1.000000    0.576810    4.649493 -4.849421e-01   \n",
       "9            0     0.000000    0.000000    0.217389    0.441210  1.524558e+00   \n",
       "10           0     0.666667    1.000000    0.433001    0.000007 -4.832136e-01   \n",
       "11           0     0.000000    0.268282    0.099387    0.000000  1.524557e+00   \n",
       "12           0     0.000000    0.000000    0.527799    1.936730  5.161895e-01   \n",
       "13           0     1.000000    1.000000    0.604172    0.000000 -1.000000e+00   \n",
       "14           0     0.000000    0.268282    0.000000    0.000000  0.000000e+00   \n",
       "15           0     0.000000    0.268282    0.000000    0.000000  0.000000e+00   \n",
       "16           0     0.000000    0.268282    0.000000    0.000000  0.000000e+00   \n",
       "17           0     0.000000    0.268282    0.198676    0.000000  5.414258e-01   \n",
       "18           0     0.000000    0.000000    0.056423    1.518717  0.000000e+00   \n",
       "19           0     0.000000    0.268282    0.055742    0.000000  0.000000e+00   \n",
       "20           0     0.000000    0.268282    0.079278    0.000000  6.306272e-01   \n",
       "21           0     0.000000    0.268282    0.089385    0.000000  0.000000e+00   \n",
       "22           0     1.000000    0.268282    0.638245    0.000000 -1.000000e+00   \n",
       "23           0     0.000000    0.268282    0.065172    0.000000  6.944240e-01   \n",
       "24           0     0.000000    0.268282    0.091327    0.000000  0.000000e+00   \n",
       "25           0     0.000000    0.268282    0.063161    0.000000  6.904130e-01   \n",
       "26           0     0.000000    0.268282    0.079437    0.000000  2.264284e-06   \n",
       "27           0     0.000000    0.268282    0.065574    0.000000  6.904130e-01   \n",
       "28           0     0.000000    0.268282    0.061933    0.000000  6.904130e-01   \n",
       "29           0     1.000000    0.268282    0.704432    0.000000 -1.000000e+00   \n",
       "...        ...          ...         ...         ...         ...           ...   \n",
       "15368        0     0.000000    0.268282    0.084134    0.000000  5.118057e-01   \n",
       "15369        0     1.000000    0.268282    0.624248    0.000000 -1.000000e+00   \n",
       "15370        0     0.000000    0.000000    0.249453    0.000000  8.891856e-02   \n",
       "15371        0     0.000000    0.268282    0.048140    0.000000  2.221878e-07   \n",
       "15372        0     0.000000    0.268282    0.135850    0.000000  3.724090e-03   \n",
       "15373        0     0.000000    0.268282    0.193901    0.000000  3.724090e-03   \n",
       "15374        0     0.000000    0.268282    0.168835    0.000000  1.012446e-01   \n",
       "15375        0     1.000000    0.268282    0.731381    0.000000 -9.962759e-01   \n",
       "15376        0     0.000000    0.268282    0.148792    0.000000  9.152101e-02   \n",
       "15377        0     1.000000    0.268282    0.698275    0.000000 -9.962759e-01   \n",
       "15378        0     1.000000    0.268282    0.715636    0.000000 -9.925518e-01   \n",
       "15379        0     0.000000    0.268282    0.134697    0.000000  3.723854e-03   \n",
       "15380        0     1.000000    0.268282    0.726408    0.000000 -1.617411e-01   \n",
       "15381        0     0.000000    0.268282    0.098446    0.000000  8.382589e-01   \n",
       "15382        0     0.000000    0.268282    0.136332    0.000000  8.382589e-01   \n",
       "15383        0     1.000000    0.268282    0.742575    0.000000 -1.617411e-01   \n",
       "15384        0     0.000000    0.268282    0.097170    0.000000  1.052417e+00   \n",
       "15385        0     0.000000    0.268282    0.139060    0.000000  8.382589e-01   \n",
       "15386        0     0.000000    0.268282    0.027634    0.000000  9.912685e-01   \n",
       "15387        1     1.000000    0.268282    0.687435    0.000000 -1.000000e+00   \n",
       "15388        0     0.000000    0.000000    0.241446    0.000000  1.416244e-01   \n",
       "15389        0     0.000000    0.268282    0.043293    0.000000  7.774709e-01   \n",
       "15390        0     0.000000    0.268282    0.021873    0.000000  1.221655e-02   \n",
       "15391        0     0.000000    0.268282    0.039033    0.000000  9.912685e-01   \n",
       "15392        0     0.000000    0.268282    0.076621    0.000000  0.000000e+00   \n",
       "15393        0     0.000000    0.268282    0.086058    0.000000  9.450563e-01   \n",
       "15394        0     0.000000    0.268282    0.076749    0.000000  9.781806e-01   \n",
       "15395        0     0.000000    0.268282    0.078115    0.000000  7.146114e-01   \n",
       "15396        0     0.000000    0.268282    0.064235    0.000000  9.116081e-01   \n",
       "15397        0     1.000000    0.268282    0.657683    0.000000 -1.000000e+00   \n",
       "\n",
       "       evt_c_reco  user_pop  frnd_infl   evt_pop  interested  not_interested  \n",
       "0        0.942729  0.000231        0.0 -0.000039           0               0  \n",
       "1        0.680113  0.000231        0.0  0.000018           0               0  \n",
       "2       -1.000000  0.000231        0.0  0.000173           1               0  \n",
       "3        0.752357  0.000231        0.0  0.000016           0               0  \n",
       "4        0.984118  0.000231        0.0  0.000064           0               0  \n",
       "5        0.984118  0.000231        0.0  0.000235           0               0  \n",
       "6        2.975531  0.000160        0.0  0.000016           0               0  \n",
       "7        0.788799  0.000160        0.0  0.000566           1               0  \n",
       "8        0.951921  0.000160        0.0  0.001215           1               0  \n",
       "9        2.794073  0.000160        0.0 -0.000014           0               0  \n",
       "10       0.763753  0.000160        0.0  0.000060           1               0  \n",
       "11       2.739166  0.000160        0.0 -0.000058           0               0  \n",
       "12       2.837133  0.000160        0.0  0.000230           0               0  \n",
       "13      -1.000000  0.000076        0.0  0.000258           1               0  \n",
       "14       0.995952  0.000076        0.0 -0.000081           0               0  \n",
       "15       0.999604  0.000076        0.0  0.000060           0               0  \n",
       "16       0.997483  0.000076        0.0  0.000018           0               0  \n",
       "17       0.998719  0.000076        0.0  0.000012           0               0  \n",
       "18       0.995952  0.000076        0.0 -0.000055           0               0  \n",
       "19       0.787261  0.000015        0.0  0.000005           0               0  \n",
       "20       0.998451  0.000015        0.0  0.000090           0               0  \n",
       "21       0.994036  0.000015        0.0  0.000037           0               0  \n",
       "22      -1.000000  0.000015        0.0  0.000012           1               0  \n",
       "23       0.996427  0.000015        0.0  0.000012           0               0  \n",
       "24       0.997275  0.000015        0.0  0.000028           0               0  \n",
       "25       0.952145  0.000426        0.0  0.000025           0               0  \n",
       "26       0.816832  0.000426        0.0  0.000573           0               0  \n",
       "27       0.833035  0.000426        0.0  0.000074           0               0  \n",
       "28       0.825322  0.000426        0.0  0.000046           0               0  \n",
       "29      -1.000000  0.000426        0.0  0.000060           1               0  \n",
       "...           ...       ...        ...       ...         ...             ...  \n",
       "15368    0.971498  0.000218        0.0  0.000039           0               0  \n",
       "15369   -1.000000  0.000218        0.0  0.000048           1               0  \n",
       "15370    0.562281  0.000218        0.0  0.000260           0               0  \n",
       "15371    0.797915  0.000218        0.0  0.000000           0               0  \n",
       "15372    2.255594  0.000024        0.0  0.000009           0               0  \n",
       "15373    2.055693  0.000024        0.0  0.000025           0               0  \n",
       "15374    2.557705  0.000024        0.0  0.000108           0               0  \n",
       "15375    0.761978  0.000024        0.0  0.000032           1               0  \n",
       "15376    2.546210  0.000024        0.0  0.000023           0               0  \n",
       "15377    0.712091  0.000024        0.0  0.000081           1               0  \n",
       "15378    0.816791  0.000024        0.0  0.000021           1               0  \n",
       "15379    2.467301  0.000024        0.0  0.000055           0               0  \n",
       "15380   -0.000419  0.000291        0.0  0.000000           1               0  \n",
       "15381    1.959044  0.000291        0.0  0.000000           0               0  \n",
       "15382    1.994727  0.000291        0.0  0.000012           0               0  \n",
       "15383   -0.000419  0.000291        0.0  0.000023           1               0  \n",
       "15384    1.747798  0.000291        0.0  0.000028           0               0  \n",
       "15385    1.999084  0.000291        0.0  0.000000           0               0  \n",
       "15386    0.916116  0.000222        0.0  0.000012           0               0  \n",
       "15387   -1.000000  0.000222        0.0 -0.000032           1               0  \n",
       "15388    0.221330  0.000222        0.0  0.000037           0               0  \n",
       "15389    0.731846  0.000222        0.0  0.000067           0               0  \n",
       "15390    0.976098  0.000222        0.0  0.000032           0               0  \n",
       "15391    0.821143  0.000222        0.0  0.000018           0               0  \n",
       "15392    0.000000  0.000129        0.0  0.000083           0               0  \n",
       "15393    0.889712  0.000129        0.0  0.000196           0               0  \n",
       "15394    0.938683  0.000129        0.0  0.000081           0               0  \n",
       "15395    0.901552  0.000129        0.0  0.000384           0               0  \n",
       "15396    0.818156  0.000129        0.0 -0.002080           0               0  \n",
       "15397   -1.000000  0.000129        0.0  0.000018           1               0  \n",
       "\n",
       "[15398 rows x 12 columns]"
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import pandas as pd\n",
    "train = pd.read_csv('RS_train.csv')\n",
    "train"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.000000    1236\n",
       "1.000000      28\n",
       "0.013770       3\n",
       "0.072493       3\n",
       "0.066962       3\n",
       "0.059094       3\n",
       "0.186979       3\n",
       "0.055756       3\n",
       "0.208771       3\n",
       "0.100803       3\n",
       "0.074876       3\n",
       "0.092081       3\n",
       "0.351250       3\n",
       "0.097883       2\n",
       "0.491585       2\n",
       "0.066919       2\n",
       "0.083581       2\n",
       "0.058547       2\n",
       "0.069553       2\n",
       "0.069124       2\n",
       "0.000345       2\n",
       "0.069371       2\n",
       "0.113749       2\n",
       "0.043754       2\n",
       "0.083250       2\n",
       "0.135789       2\n",
       "0.067554       2\n",
       "0.071773       2\n",
       "0.096796       2\n",
       "0.115313       2\n",
       "            ... \n",
       "0.034515       1\n",
       "0.067687       1\n",
       "0.541199       1\n",
       "0.082297       1\n",
       "0.716805       1\n",
       "0.196104       1\n",
       "0.115245       1\n",
       "0.089492       1\n",
       "0.092884       1\n",
       "0.206654       1\n",
       "0.054646       1\n",
       "0.631870       1\n",
       "0.241462       1\n",
       "0.006439       1\n",
       "0.452198       1\n",
       "0.160368       1\n",
       "0.034694       1\n",
       "0.118435       1\n",
       "0.076739       1\n",
       "0.778272       1\n",
       "0.403659       1\n",
       "0.124042       1\n",
       "0.804085       1\n",
       "0.116260       1\n",
       "0.088813       1\n",
       "0.088838       1\n",
       "0.633784       1\n",
       "0.091322       1\n",
       "0.196137       1\n",
       "0.037433       1\n",
       "Name: svdCF_reco, Length: 13966, dtype: int64"
      ]
     },
     "execution_count": 33,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "train.svdCF_reco.value_counts()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>invited</th>\n",
       "      <th>userCF_reco</th>\n",
       "      <th>evtCF_reco</th>\n",
       "      <th>svdCF_reco</th>\n",
       "      <th>user_reco</th>\n",
       "      <th>evt_p_reco</th>\n",
       "      <th>evt_c_reco</th>\n",
       "      <th>user_pop</th>\n",
       "      <th>frnd_infl</th>\n",
       "      <th>evt_pop</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.986916</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.181869e-04</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000138</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.951928</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.181869e-04</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000030</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.181869e-04</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.181869e-04</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000069</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.181869e-04</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000046</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>0</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.181869e-04</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>0</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.181869e-04</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000025</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>0</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>9.111918e-06</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000014</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>0</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>9.111918e-06</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000143</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>0</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>9.111918e-06</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000025</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>0</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>9.111918e-06</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000260</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>0</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>9.111918e-06</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000106</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>0</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>9.111918e-06</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000044</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>0</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>9.111918e-06</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000030</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>0</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>9.111918e-06</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000196</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>0</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>9.111918e-06</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000223</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>0</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>9.111918e-06</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000039</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>0</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.219389e-04</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000092</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>0</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.162517</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.219389e-04</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000005</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>0</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.219389e-04</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000044</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>0</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.219389e-04</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000184</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>0</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.219389e-04</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.002031</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>0</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.374563</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.219389e-04</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000200</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>0</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.071990e-06</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000016</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>0</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.071990e-06</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000016</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>0</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.071990e-06</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000002</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>0</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.071990e-06</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000028</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>0</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.071990e-06</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000005</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>0</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.071990e-06</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000016</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>0</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.683299</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5.885227e-04</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000108</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10207</th>\n",
       "      <td>0</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.420387e-04</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-0.000025</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10208</th>\n",
       "      <td>0</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.420387e-04</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000023</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10209</th>\n",
       "      <td>0</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.420387e-04</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000092</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10210</th>\n",
       "      <td>0</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.420387e-04</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000104</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10211</th>\n",
       "      <td>0</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.420387e-04</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-0.000120</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10212</th>\n",
       "      <td>0</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.420387e-04</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-0.000035</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10213</th>\n",
       "      <td>0</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.420387e-04</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000039</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10214</th>\n",
       "      <td>0</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.420387e-04</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000037</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10215</th>\n",
       "      <td>0</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.791023</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5.893267e-04</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000189</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10216</th>\n",
       "      <td>0</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.553465</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5.893267e-04</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000925</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10217</th>\n",
       "      <td>0</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.551666</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5.893267e-04</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000173</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10218</th>\n",
       "      <td>0</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.091360</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5.893267e-04</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000361</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10219</th>\n",
       "      <td>0</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5.893267e-04</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10220</th>\n",
       "      <td>0</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.603702</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5.893267e-04</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000255</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10221</th>\n",
       "      <td>0</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.722622</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5.893267e-04</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000589</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10222</th>\n",
       "      <td>0</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.311360</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5.893267e-04</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000235</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10223</th>\n",
       "      <td>0</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.271997</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5.893267e-04</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000064</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10224</th>\n",
       "      <td>0</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.225471</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5.893267e-04</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000032</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10225</th>\n",
       "      <td>0</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.651871</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5.453751e-04</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-0.000048</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10226</th>\n",
       "      <td>0</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.147896</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5.453751e-04</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-0.000048</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10227</th>\n",
       "      <td>0</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.777875</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5.453751e-04</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000014</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10228</th>\n",
       "      <td>0</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.886110</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5.453751e-04</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000076</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10229</th>\n",
       "      <td>0</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.418006</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5.453751e-04</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000039</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10230</th>\n",
       "      <td>0</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.602303</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5.453751e-04</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000184</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10231</th>\n",
       "      <td>0</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>8.039927e-07</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10232</th>\n",
       "      <td>0</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.904344</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>8.039927e-07</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000039</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10233</th>\n",
       "      <td>0</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.743912</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>8.039927e-07</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000023</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10234</th>\n",
       "      <td>0</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>8.039927e-07</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000012</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10235</th>\n",
       "      <td>0</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>8.039927e-07</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000016</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10236</th>\n",
       "      <td>0</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>0.268282</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>8.039927e-07</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000030</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>10237 rows × 10 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "       invited  userCF_reco  evtCF_reco  svdCF_reco  user_reco  evt_p_reco  \\\n",
       "0            0     0.268282    0.268282    0.986916        0.0         0.0   \n",
       "1            0     0.268282    0.268282    0.951928        0.0         0.0   \n",
       "2            0     0.268282    0.268282    1.000000        0.0         0.0   \n",
       "3            0     0.268282    0.268282    1.000000        0.0         0.0   \n",
       "4            0     0.268282    0.268282    1.000000        0.0         0.0   \n",
       "5            0     0.268282    0.268282    1.000000        0.0         0.0   \n",
       "6            0     0.268282    0.268282    1.000000        0.0         0.0   \n",
       "7            0     0.268282    0.268282    1.000000        0.0         0.0   \n",
       "8            0     0.268282    0.268282    1.000000        0.0         0.0   \n",
       "9            0     0.268282    0.268282    1.000000        0.0         0.0   \n",
       "10           0     0.268282    0.268282    1.000000        0.0         0.0   \n",
       "11           0     0.268282    0.268282    1.000000        0.0         0.0   \n",
       "12           0     0.268282    0.268282    1.000000        0.0         0.0   \n",
       "13           0     0.268282    0.268282    1.000000        0.0         0.0   \n",
       "14           0     0.268282    0.268282    1.000000        0.0         0.0   \n",
       "15           0     0.268282    0.268282    1.000000        0.0         0.0   \n",
       "16           0     0.268282    0.268282    1.000000        0.0         0.0   \n",
       "17           0     0.268282    0.268282    1.000000        0.0         0.0   \n",
       "18           0     0.268282    0.268282    0.162517        0.0         0.0   \n",
       "19           0     0.268282    0.268282    1.000000        0.0         0.0   \n",
       "20           0     0.268282    0.268282    1.000000        0.0         0.0   \n",
       "21           0     0.268282    0.268282    1.000000        0.0         0.0   \n",
       "22           0     0.268282    0.268282    0.374563        0.0         0.0   \n",
       "23           0     0.268282    0.268282    1.000000        0.0         0.0   \n",
       "24           0     0.268282    0.268282    1.000000        0.0         0.0   \n",
       "25           0     0.268282    0.268282    1.000000        0.0         0.0   \n",
       "26           0     0.268282    0.268282    1.000000        0.0         0.0   \n",
       "27           0     0.268282    0.268282    1.000000        0.0         0.0   \n",
       "28           0     0.268282    0.268282    1.000000        0.0         0.0   \n",
       "29           0     0.268282    0.268282    0.683299        0.0         0.0   \n",
       "...        ...          ...         ...         ...        ...         ...   \n",
       "10207        0     0.268282    0.268282    1.000000        0.0         0.0   \n",
       "10208        0     0.268282    0.268282    1.000000        0.0         0.0   \n",
       "10209        0     0.268282    0.268282    1.000000        0.0         0.0   \n",
       "10210        0     0.268282    0.268282    1.000000        0.0         0.0   \n",
       "10211        0     0.268282    0.268282    1.000000        0.0         0.0   \n",
       "10212        0     0.268282    0.268282    1.000000        0.0         0.0   \n",
       "10213        0     0.268282    0.268282    1.000000        0.0         0.0   \n",
       "10214        0     0.268282    0.268282    1.000000        0.0         0.0   \n",
       "10215        0     0.268282    0.268282    0.791023        0.0         0.0   \n",
       "10216        0     0.268282    0.268282    0.553465        0.0         0.0   \n",
       "10217        0     0.268282    0.268282    0.551666        0.0         0.0   \n",
       "10218        0     0.268282    0.268282    0.091360        0.0         0.0   \n",
       "10219        0     0.268282    0.268282    1.000000        0.0         0.0   \n",
       "10220        0     0.268282    0.268282    0.603702        0.0         0.0   \n",
       "10221        0     0.268282    0.268282    0.722622        0.0         0.0   \n",
       "10222        0     0.268282    0.268282    0.311360        0.0         0.0   \n",
       "10223        0     0.268282    0.268282    0.271997        0.0         0.0   \n",
       "10224        0     0.268282    0.268282    0.225471        0.0         0.0   \n",
       "10225        0     0.268282    0.268282    0.651871        0.0         0.0   \n",
       "10226        0     0.268282    0.268282    0.147896        0.0         0.0   \n",
       "10227        0     0.268282    0.268282    0.777875        0.0         0.0   \n",
       "10228        0     0.268282    0.268282    0.886110        0.0         0.0   \n",
       "10229        0     0.268282    0.268282    0.418006        0.0         0.0   \n",
       "10230        0     0.268282    0.268282    0.602303        0.0         0.0   \n",
       "10231        0     0.268282    0.268282    1.000000        0.0         0.0   \n",
       "10232        0     0.268282    0.268282    0.904344        0.0         0.0   \n",
       "10233        0     0.268282    0.268282    0.743912        0.0         0.0   \n",
       "10234        0     0.268282    0.268282    1.000000        0.0         0.0   \n",
       "10235        0     0.268282    0.268282    1.000000        0.0         0.0   \n",
       "10236        0     0.268282    0.268282    1.000000        0.0         0.0   \n",
       "\n",
       "       evt_c_reco      user_pop  frnd_infl   evt_pop  \n",
       "0             0.0  1.181869e-04        0.0  0.000138  \n",
       "1             0.0  1.181869e-04        0.0  0.000030  \n",
       "2             0.0  1.181869e-04        0.0  0.000058  \n",
       "3             0.0  1.181869e-04        0.0  0.000069  \n",
       "4             0.0  1.181869e-04        0.0  0.000046  \n",
       "5             0.0  1.181869e-04        0.0  0.000000  \n",
       "6             0.0  1.181869e-04        0.0  0.000025  \n",
       "7             0.0  9.111918e-06        0.0  0.000014  \n",
       "8             0.0  9.111918e-06        0.0  0.000143  \n",
       "9             0.0  9.111918e-06        0.0  0.000025  \n",
       "10            0.0  9.111918e-06        0.0  0.000260  \n",
       "11            0.0  9.111918e-06        0.0  0.000106  \n",
       "12            0.0  9.111918e-06        0.0  0.000044  \n",
       "13            0.0  9.111918e-06        0.0  0.000030  \n",
       "14            0.0  9.111918e-06        0.0  0.000196  \n",
       "15            0.0  9.111918e-06        0.0  0.000223  \n",
       "16            0.0  9.111918e-06        0.0  0.000039  \n",
       "17            0.0  1.219389e-04        0.0  0.000092  \n",
       "18            0.0  1.219389e-04        0.0  0.000005  \n",
       "19            0.0  1.219389e-04        0.0  0.000044  \n",
       "20            0.0  1.219389e-04        0.0  0.000184  \n",
       "21            0.0  1.219389e-04        0.0  0.002031  \n",
       "22            0.0  1.219389e-04        0.0  0.000200  \n",
       "23            0.0  1.071990e-06        0.0  0.000016  \n",
       "24            0.0  1.071990e-06        0.0  0.000016  \n",
       "25            0.0  1.071990e-06        0.0  0.000002  \n",
       "26            0.0  1.071990e-06        0.0  0.000028  \n",
       "27            0.0  1.071990e-06        0.0  0.000005  \n",
       "28            0.0  1.071990e-06        0.0  0.000016  \n",
       "29            0.0  5.885227e-04        0.0  0.000108  \n",
       "...           ...           ...        ...       ...  \n",
       "10207         0.0  1.420387e-04        0.0 -0.000025  \n",
       "10208         0.0  1.420387e-04        0.0  0.000023  \n",
       "10209         0.0  1.420387e-04        0.0  0.000092  \n",
       "10210         0.0  1.420387e-04        0.0  0.000104  \n",
       "10211         0.0  1.420387e-04        0.0 -0.000120  \n",
       "10212         0.0  1.420387e-04        0.0 -0.000035  \n",
       "10213         0.0  1.420387e-04        0.0  0.000039  \n",
       "10214         0.0  1.420387e-04        0.0  0.000037  \n",
       "10215         0.0  5.893267e-04        0.0  0.000189  \n",
       "10216         0.0  5.893267e-04        0.0  0.000925  \n",
       "10217         0.0  5.893267e-04        0.0  0.000173  \n",
       "10218         0.0  5.893267e-04        0.0  0.000361  \n",
       "10219         0.0  5.893267e-04        0.0  0.000000  \n",
       "10220         0.0  5.893267e-04        0.0  0.000255  \n",
       "10221         0.0  5.893267e-04        0.0  0.000589  \n",
       "10222         0.0  5.893267e-04        0.0  0.000235  \n",
       "10223         0.0  5.893267e-04        0.0  0.000064  \n",
       "10224         0.0  5.893267e-04        0.0  0.000032  \n",
       "10225         0.0  5.453751e-04        0.0 -0.000048  \n",
       "10226         0.0  5.453751e-04        0.0 -0.000048  \n",
       "10227         0.0  5.453751e-04        0.0  0.000014  \n",
       "10228         0.0  5.453751e-04        0.0  0.000076  \n",
       "10229         0.0  5.453751e-04        0.0  0.000039  \n",
       "10230         0.0  5.453751e-04        0.0  0.000184  \n",
       "10231         0.0  8.039927e-07        0.0  0.000000  \n",
       "10232         0.0  8.039927e-07        0.0  0.000039  \n",
       "10233         0.0  8.039927e-07        0.0  0.000023  \n",
       "10234         0.0  8.039927e-07        0.0  0.000012  \n",
       "10235         0.0  8.039927e-07        0.0  0.000016  \n",
       "10236         0.0  8.039927e-07        0.0  0.000030  \n",
       "\n",
       "[10237 rows x 10 columns]"
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import pandas as pd\n",
    "test = pd.read_csv('RS_test.csv')\n",
    "test"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "时间、地点等特征都没有处理了，可以考虑用户看到event的时间与event开始时间的差、用户地点和event地点的差异。。。"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.14"
  },
  "toc": {
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": "block",
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
